project(test)

#aux_source_directory(imgui imgui)
# set(imgui
# 	imgui/main.cpp
# 	imgui/widgets.cpp
# 	imgui/command.cpp
# 	client/clientproxy.cpp
# 	client/client.cpp
# 	client/rectification/video.cpp
# 	)

add_executable(syntax syntax/main.cpp)
target_include_directories(syntax PUBLIC "hub/business")
target_link_libraries(syntax network sqlite3)

add_executable(cereal syntax/cereal.cpp)
target_link_libraries(cereal jansson_d)

add_executable(decoder sdl2/decode_video.cpp sdl2/window.cpp)
target_link_directories(decoder PUBLIC ${root}/3rd/ffmpeg/lib)
target_include_directories(decoder PUBLIC ${root}/3rd/ffmpeg/include)
target_link_libraries(decoder 
	sdl2maind
	sdl2d
	avcodec
	avformat
	avutil
	avdevice
	)

add_executable(janson janson/main.cpp)
target_link_libraries(janson jansson_d)

add_executable(c network/c.cpp)
target_link_libraries(c network)

add_executable(s network/s.cpp)
target_link_libraries(s 
	flv
	rtmp
	network)

add_executable(asio 
	asio/rtmp.cpp
	asio/async_server.cpp)
add_executable(c-asio asio/async_client.cpp)
target_compile_options(asio PUBLIC -DASIO_STANDALONE)
target_compile_options(c-asio PUBLIC -DASIO_STANDALONE)
target_include_directories(asio PUBLIC "${root}/3rd")
target_include_directories(c-asio PUBLIC "${root}/3rd")
target_link_libraries(asio librtmp libflv)
target_link_libraries(c-asio PUBLIC librtmp libflv)

add_custom_target(echo)
add_dependencies(echo ates btec)

add_executable(ates asio/async_tcp_echo_server.cpp)
target_include_directories(ates PUBLIC "${root}/3rd")
add_executable(btec asio/blocking_tcp_echo_client.cpp)
target_include_directories(btec PUBLIC "${root}/3rd")
# add_executable(gui ${imgui})
# target_include_directories(gui PUBLIC "client")
# target_include_directories(gui PUBLIC "imgui")
# add_dependencies(gui imgui network)
# target_link_libraries(gui imgui sdl2maind network jansson_d)

#add_subdirectory(client)
# add_subdirectory(asio)
